package com.sudo.dao.admin.model.bo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sudo.common.utils.PatternUtil;
import com.sudo.common.validenum.EnumValue;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.time.LocalDateTime;

/**
 * @author 为道日损 2020-04-27 16:52
 */
@Data
public class SysAutoRoleUpdateBO {
    @NotBlank(message = "用户名不能为空")
    @Length(min = 4, max = 10, message = "用户名必须由4~10个字符组成")
    @Pattern(regexp= PatternUtil.USERNAME,message="用户名必须是4~10位数字、字母或下划线")
    private String username;

    private String setupRole;

    private String expiryRole;

    @NotBlank(message = "自动化状态不能为空")
    @EnumValue(strValues = {"ON","OFF"},message = "自动化状态必须为指定值ON/OFF")
    private String status;

    private LocalDateTime expirationTime;
}
